<?php session_start();
validaAcesso();

echo "<h2>Cadastro de ".$_SESSION["menu"]["cad"][19]." da UH: {$_SESSION["NOME_HOSTEL_"]}</h2>";

require_once ("funcoes/hostel_almoxarifado.jsp");

//require_once ("funcoes/hostel_item.jsp");
//require_once ("funcoes/hostel_categoria_item.jsp");


if(isset($_GET[grava])==1){

	setEntradaItem0(0,$_POST["p_item"], $_POST["pano"]."-".$_POST["pmes"]."-".$_POST["pdia"], $_POST["pvl_entrada"],$_POST["pqtde"], $_SESSION["ID_HOSTEL_"],$_SESSION["loginCK_"],$_POST["pvl_saida"],"0000-00-00",0);
	
}
?>

<br>
<form method="POST" action="index.jsp?grava=1&cad=19" autocomplete="off">

<div class='item'><h5>Item:</h5>
<select name="p_item">
<?php
require_once ("funcoes/hostel_item.jsp");
//require_once ("funcoes/hostel_item.jsp");
getItem(0,"select");
?>
</select>

<b id='ok'>*</b></div>

<div class='item'><h5>Data de Entrada:</h5>
<input type="text" size="2"  maxlength="2" name="pdia" value="<?php echo date("d"); ?>"> / <input type="text" size="2"  maxlength="2" name="pmes" value="<?php echo date("m"); ?>"> / <input type="text" size="4"  maxlength="4" name="pano" value="<?php echo date("Y"); ?>">
 <b id='ok'>*</b> Ex: dd/mm/aaaa
 
<div class='item'><h5>Valor Unit. de Entrada:</h5><input type="text" size="4" maxlength="6" name="pvl_entrada"> <b id='ok'>*</b> Ex: 5.20</div>

<div class='item'><h5>Valor Unit. de Sa&iacute;da:</h5><input type="text" size="4" maxlength="6" name="pvl_saida"> <b id='ok'>*</b> Ex: 5.20</div>

<div class='item'><h5>Quantidade:</h5><input type="text" size="4" maxlength="5" name="pqtde"> <b id='ok'></b></div>

<div class='item'><h5> </h5><input type="submit" value="cadastrar"></div>

</form>


<?php
require_once ("funcoes/com_hostels");
getHostels(0,"lista");
?>